package com.ts.api.module.api.entity.qo;

import com.ts.api.common.constant.api.ApiBizTypeEnum;
import lombok.Data;

/**
 *  API传输表单校验查询
 */
@Data
public class ApiRequiredRuleQO {

    /** api客户端id */
    private String apiClientId;
    /** 0撞库类型规则，1进件类型规则 */
    private Integer type;

    public ApiRequiredRuleQO() {
        super();
    }

    public ApiRequiredRuleQO(String apiClientId, Integer type) {
        this.apiClientId = apiClientId;
        this.type = type;
    }

    public static ApiRequiredRuleQO create(String apiClientId, ApiBizTypeEnum apiBizTypeEnum) {
        return new ApiRequiredRuleQO(apiClientId, apiBizTypeEnum.getType());
    }

    public static ApiRequiredRuleQO createDataExchange(String apiClientId) {
        return create(apiClientId, ApiBizTypeEnum.DATA_EXCHANGE);
    }

    public static ApiRequiredRuleQO createApply(String apiClientId) {
        return create(apiClientId, ApiBizTypeEnum.APPLY);
    }

}
